<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
</script>

<template>
  <div class="app-container">
    <header class="app-header">
      <div class="header-content">
        <div class="header-left">
          <img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="40" height="40" />
          <h1 class="app-title">医疗管理系统</h1>
        </div>
        <nav class="nav-menu">
          <RouterLink to="/" class="nav-link">
            <span>首页</span>
          </RouterLink>
          <RouterLink to="/about" class="nav-link">
            <span>关于</span>
          </RouterLink>
          <RouterLink to="/registration-slip" class="nav-link">
            <span>挂号单设置</span>
          </RouterLink>
          <RouterLink to="/outpatient-slip" class="nav-link">
            <span>门诊单设置</span>
          </RouterLink>
          <RouterLink to="/inpatient-slip" class="nav-link">
            <span>住院单设置</span>
          </RouterLink>
          <RouterLink to="/department-management" class="nav-link">
            <span>科室管理</span>
          </RouterLink>
          <RouterLink to="/employee-add" class="nav-link">
            <span>员工添加</span>
          </RouterLink>
          <RouterLink to="/permission-management" class="nav-link">
            <span>权限管理</span>
          </RouterLink>
        </nav>
      </div>
    </header>

    <main class="app-main">
      <RouterView />
    </main>
  </div>
</template>

<style scoped>
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f5f5;
}

.app-header {
  background: #fff;
  border-bottom: 1px solid #e4e7ed;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: block;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.1);
}

.app-title {
  font-size: 20px;
  font-weight: 600;
  color: #303133;
  margin: 0;
  letter-spacing: 0.5px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  color: #606266;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
  height: 40px;
}

.nav-link:hover {
  color: #409eff;
  background-color: rgba(64, 158, 255, 0.1);
}

.nav-link.router-link-exact-active {
  color: #409eff;
  background-color: rgba(64, 158, 255, 0.1);
  font-weight: 600;
}

.nav-link.router-link-exact-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background-color: #409eff;
  border-radius: 1px;
}

.app-main {
  flex: 1;
  width: 100%;
  min-height: calc(100vh - 64px);
}

@media (max-width: 768px) {
  .header-content {
    padding: 0 16px;
    height: 56px;
  }

  .app-title {
    font-size: 16px;
  }

  .logo {
    width: 32px;
    height: 32px;
  }

  .nav-menu {
    gap: 4px;
  }

  .nav-link {
    padding: 6px 12px;
    font-size: 13px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .header-left {
    gap: 8px;
  }

  .app-title {
    font-size: 14px;
  }

  .nav-link {
    padding: 6px 10px;
    font-size: 12px;
  }
}
</style>
